<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form action="<?php echo url_for('news/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
  <input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
<?php echo $form->renderGlobalErrors() ?>
<?php echo $form->renderHiddenFields() ?>
  <table class="form">
    <tfoot>
      <tr>
        <td colspan="2">
          <a class="btn darkblue" href="<?php echo url_for('news/index') ?>">Cancelar</a>
          <?php if (!$form->getObject()->isNew()): ?>
            <?php echo link_to('Remover', 'news_delete', $form->getObject(), array('class' => 'btn darkblue', 'method' => 'delete', 'confirm' => 'Voc&ecirc; tem certeza?')) ?>
          <?php endif; ?>
          <input class="submit_btn darkblue" type="submit" value="Salvar" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <tr>
        <th><?php echo $form['summary']->renderLabel() ?></th>
        <td>
          <?php echo $form['summary'] ?>
        </td>
        <td>
          <?php echo $form['summary']->renderError() ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['description']->renderLabel() ?></th>
        <td>
          <?php echo $form['description'] ?>
        </td>
        <td>
          <?php echo $form['description']->renderError() ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['category_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['category_id'] ?>
        </td>
        <td>
          <?php echo $form['category_id']->renderError() ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['subcategory_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['subcategory_id'] ?>
        </td>
        <td>
          <?php echo $form['subcategory_id']->renderError() ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['send_email']->renderLabel() ?></th>
        <td>
          <?php echo $form['send_email'] ?>
        </td>
        <td>
          <?php echo $form['send_email']->renderError() ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
